import { ConfigManager } from "../../../com/gengine/resource/ConfigManager";
import { CommonActiveInfo } from "./commonActive/CommonActiveInfo";
type int = number;
//class CommonActiveConfig
    
    export  class CommonActiveConfig
    {
        constructor()
        {
            
            this._map = new Map<any, any> /* flash.utils.Dictionary */();
            if (CommonActiveConfig._instance != null) 
            {
                throw new Error(" CommonActiveConfig 单例 ");
            }
            CommonActiveConfig._instance = this;
            this.init();
            return;
        }

        /* internal  */init(): void
        {
            var loc1=ConfigManager.instance.getJSONByFileName("commonActiveConfig.json");
            this.write(loc1);
            return;
        }

        /* internal  */write(arg1: Object): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=0;
            var loc4=arg1;
            for(loc2 of loc4) 
            {
                loc1 = new CommonActiveInfo();
                loc1.id = loc2.id;
                loc1.title = loc2.title;
                loc1.category = loc2.category;
                loc1.type = loc2.type;
                loc1.rewards = loc2.rewards;
                loc1.itemcodes = loc2.itemcodes;
                loc1.tip1 = loc2.tip1;
                loc1.tip2 = loc2.tip2;
                loc1.tip3 = loc2.tip3;
                loc1.tip4 = loc2.tip4;
                loc1.tip5 = loc2.tip5;
                loc1.tip6 = loc2.tip6;
                loc1.tip7 = loc2.tip7;
                loc1.tip8 = loc2.tip8;
                loc1.tip9 = loc2.tip9;
                this._map[loc1.id] = loc1;
            }
            return;
        }

        public getCommonActiveInfo(arg1: int): CommonActiveInfo
        {
            return this._map[arg1];
        }

        public static get instance(): CommonActiveConfig
        {
            if (CommonActiveConfig._instance == null) 
            {
                CommonActiveConfig._instance = new CommonActiveConfig();
            }
            return CommonActiveConfig._instance;
        }

        /* internal */ /* var */_map: Map<any, any> /* flash.utils.Dictionary */;

        /* internal */ static /* var */_instance: CommonActiveConfig;
    }
